import { defineStore } from 'pinia';
import type RoutePathType from '../commons/types/route-path-type';
import type UserInfo from '../commons/types/user-info-type';
import { extendFonticonUrls } from '../configs/extend-icon';
export const useVisualConfigStore = defineStore('visualConfig', {
  state: () => {
    return {
      //用户信息
      userInfo: {
        userId: '',
        userName: '',
      },
      //扩展图标
      extendFontIconUrls: [...extendFonticonUrls],
      //route地址
      routePath: {
        dashboardRoot: '',
        visualRoot:''
      },
    };
  },
  getters: {
    getExtendFontIconUrls(state) {
      return state.extendFontIconUrls;
    },
    getUserInfo(state) {
      return state.userInfo;
    },
    getRoutePath(state) {
      return state.routePath;
    },
  },
  actions: {
    setExtendFontIconUrls(extendFontIconUrls) {
      this.extendFontIconUrls = extendFontIconUrls;
    },
    setUserInfo(userInfo: UserInfo) {
      this.userInfo = userInfo;
    },
    setRoutePath(routePath: RoutePathType) {
      this.routePath = routePath;
    },
  },
});
